var http = require('http');
var config = require('./config.js');
var router = require('./router.js');
var req_res_extend = require('./req_res_extend.js');

global.session = {};

var server = http.createServer(function(req, res){
    req_res_extend(req, res);
    router(req,res);
});
server.listen(config.app.port,function(err){
    if(err) {
        console.log(err);
    }else{
        console.log('http://127.0.0.1:' + config.app.port);
    }
});